home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS04.ADF / idemo / idemo.guide (.txt) < prev    next >
Amigaguide Document  |  1985-10-26  |  8KB  |  220 lines

  1. /*** idemo.guide ***/
  2. IDEMO GUIDE
  3. =Robert J. Mical=
  4. 4 July 1985
  5. CONFIDENTIAL and PROPRIETARY
  6. Copyright (C) 1985, COMMODORE-AMIGA, INC.
  7. All Rights Reserved
  8. This file itemizes all of the functions that are testable from the idemo.c
  9. program.  This is actually just a stripped-down version of the idemo.c
  10. switch/case statements.
  11. There are two sections:  "From the Serial Port Straight to Intuition's Ears" 
  12. and "RAWKEY to a Window".  The idemo.c program is just a main
  13. loop that circles endlessly, creating new windows and screens with
  14. joyous abandon, jazzing with the colors and the Preferences, and
  15. generally misbehaving.  It talks to and listens at the serial port
  16. for its instructions.  The commands that you can send to this main
  17. loop are itemized in the "Straight" section below.  When idemo
  18. opens a window that is configured to receive RAWKEY events, you can
  19. send instructions that are specific to that window by using the
  20. commands that are itemized in the "RAWKEY" section below.
  21. ==============================================================================
  22. === From the Serial Port Straight to Idemo's Ears ============================
  23. ==============================================================================
  24. case 'A':
  25.         i = AutoRequest(RecentWindow, &BodyText1, &GoodText, &BadText,
  26.                 DISKINSERTED, NULL);
  27.         printf("Result of AutoRequest()=%lx\n", i);
  28. case 'b':
  29.         MoveScreen(workscreen, 0, -2);
  30. case 'B':
  31.         MoveScreen(workscreen, 0, 2);
  32. case 'c':       /* 'c' for crazy screen, to prove microsoft wrong */
  33.         i = 0;
  34.         while ((c = MayGetChar()) == -1)
  35.             {
  36.             workscreen = autoopenscreen(workscreen);
  37.             i++;
  38.             printf("\nscreen %ld:  press any key to quit:", i);
  39.             for (longi = 0; longi < HALFMILLION; longi++) ;
  40.             CloseScreen(workscreen);
  41.             }
  42. case 'd':
  43.         Debug();
  44. case 'D':
  45.         printf("&AlertString=%lx\n",&AlertString[0]);
  46.         DisplayAlert(RECOVERY_ALERT, AlertString, 49);
  47. case 'e':
  48.         printf("Leaving now!  Bye.\n");
  49.         exit();
  50. case 'q':
  51.         Debug();
  52. case 'p':
  53.         /* print the active window */
  54.         error = PrinterOpen(AllocSignal(-1));
  55.         if (error)
  56.             {
  57.             printf("Open Printer error=%ld\n", error);
  58.             break;
  59.             }
  60.         workscreen = IntuitionBase->ActiveScreen;
  61.         RecentWindow = IntuitionBase->ActiveWindow;
  62.         vp = &workscreen->ViewPort;
  63.         longi = (RecentWindow->Width  << 16) / RecentWindow->Height;
  64.         i = (dumpwidth * longi) >> 16;
  65.         error = PrintRPort(RecentWindow->RPort, 
  66.             vp->ColorMap, vp->Modes, 
  67.             0, 0, 
  68.             RecentWindow->Width, RecentWindow->Height,
  69.             dumpwidth, i, 
  70.             0);
  71.         if (error) printf("The DUMP error # is %ld\n",error);
  72.         PrinterClose();
  73. case 'P':
  74.         /* print the active screen */
  75.         error = PrinterOpen(AllocSignal(-1));
  76.         if (error)
  77.             {
  78.             printf("Open Printer error=%ld\n", error);
  79.             break;
  80.             }
  81.         workscreen = IntuitionBase->ActiveScreen;
  82.         vp = &workscreen->ViewPort;
  83.         printf("Short=0, Long=1:");
  84.         i = GetNum();
  85.         printf("\n");
  86.         if (i)
  87.             error = PrintRPort(&workscreen->RastPort,
  88.                     workscreen->ViewPort.ColorMap, 
  89.                     workscreen->ViewPort.Modes, 
  90.                     0, 0, 
  91.                     workscreen->Width, workscreen->Height, 
  92.                     dumpwidth, dumpheight, 0);
  93.         else
  94.             error = PrintRPort(&workscreen->RastPort,
  95.                     workscreen->ViewPort.ColorMap, 
  96.                     workscreen->ViewPort.Modes, 
  97.                     0, 0, 
  98.                     workscreen->Width, workscreen->Height / 4,
  99.                     dumpwidth, dumpheight / 4, 0);
  100.         if (error) printf("The DUMP error # is %ld\n",error);
  101.         PrinterClose();
  102. case 's':
  103.         workscreen = rjopenscreen(workscreen);
  104. case 'S':
  105.         if (workscreen)
  106.             {
  107.             CloseScreen(workscreen);
  108.             workscreen = NULL;
  109.             }
  110.         else printf("No Screen opened yet!\n");
  111. case 't':
  112.         TestITLength();
  113. case 'T':
  114.         CurrentTime(&Seconds, &Micros);
  115.         printf("what are you waiting for?  Seconds=%ld Micros=%ld\n",
  116.                 Seconds, Micros);
  117. case 'v':
  118.         printf("CloseWorkBench()=%lx\n", CloseWorkBench());
  119. case 'V':
  120.         printf("OpenWorkBench()=%lx\n", OpenWorkBench());
  121. case 'w':
  122.         rjopenwindow(workscreen);
  123. case 'W':
  124.         printf("0=8.5, 1=7.5, 2=6.5, 3=5.5, 4=4.5, other=select: ");
  125.         i = GetNum();
  126.         switch (i)
  127.             {
  128.             case 0:
  129.                 dumpwidth = 1024;
  130.                 dumpheight = 640;
  131.                 break;
  132.             case 1:
  133.                 dumpwidth = 904;
  134.                 dumpheight = 565;
  135.                 break;
  136.             case 2:
  137.                 dumpwidth = 783;
  138.                 dumpheight = 489;
  139.                 break;
  140.             case 3:
  141.                 dumpwidth = 663;
  142.                 dumpheight = 414;
  143.                 break;
  144.             case 4:
  145.                 dumpwidth = 542;
  146.                 dumpheight = 339;
  147.                 break;
  148.             default:
  149.                 printf("\nwidth:"); dumpwidth = GetNum();
  150.                 printf("\nheight:"); dumpheight = GetNum();
  151.                 break;
  152.             }
  153.         printf("\n");
  154. case 'x':
  155.         DisplayBeep(NULL);
  156. case 'z':
  157.         View = (struct View *)ViewAddress();
  158.         printf("DxOffset=%ld DyOffset=%ld\n",
  159.                 View->DxOffset, View->DyOffset);
  160. ==============================================================================
  161. === RAWKEY to a Window =======================================================
  162. ==============================================================================
  163. case 'a':
  164.         RemoveGadget(w, &ToggleGadget);
  165.         RefreshGadgets(w->FirstGadget, w);
  166.         if (ToggleGadget.Flags & SELECTED)ToggleGadget.Flags &= ~SELECTED;
  167.         else ToggleGadget.Flags |= SELECTED;
  168. case 'A':
  169.         AddGadget(w, &ToggleGadget, -1);
  170.         RefreshGadgets(w->FirstGadget, w);
  171. case 'c':
  172.         printf("What pen number: ");  pen = GetNum();
  173.         printf("\nWhat value for red: ");  red = GetNum();
  174.         printf("\nWhat value for green: ");  green = GetNum();
  175.         printf("\nWhat value for blue: ");  blue = GetNum();
  176.         SetRGB(&w->WScreen->ViewPort, pen, red, green, blue);
  177. case 'i':
  178. case 'I':
  179.         TestITLength();
  180. case 'p':
  181. case 'P':
  182.         GetDefPrefs(&prefs, sizeof(struct Preferences));
  183.         printf("&prefs=%lx\n",&prefs);
  184.         Debug();
  185. case 'R':
  186.         Request(&TestRequest[2], w);
  187. case 's':
  188.         ShowTitle(w->WScreen, FALSE);
  189. case 'S':
  190.         ShowTitle(w->WScreen, TRUE);
  191. case 'T':
  192.         SetWindowTitles(w, "Here's a new Window Title",
  193.                 "The Big-T Screen Title");
  194. case 't':
  195.         SetWindowTitles(w, -1, "The little-t Screen Title");
  196. case 'w':
  197.         WindowToBack(w);
  198. case 'W':
  199.         WindowToFront(w);
  200. case 'x':
  201.         SizeWindow(w, -2, 0);
  202. case 'X':
  203.         SizeWindow(w, 2, 0);
  204. case 'y':
  205.         SizeWindow(w, 0, -1);
  206. case 'Y':
  207.         SizeWindow(w, 0, 1);
  208. case '1':
  209.         WBenchToBack();
  210. case '!':
  211.         WBenchToFront();
  212. case '-':
  213.         MoveWindow(w, -2, 0);
  214. case '_':
  215.         MoveWindow(w, 2, 0);
  216. case '=':
  217.         MoveWindow(w, 0, -1);
  218. case '+':
  219.         MoveWindow(w, 0, 1);
  220.